package org.zjt.platform.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;


@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {


	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/css/").addResourceLocations("static/css/");
		registry.addResourceHandler("/js/").addResourceLocations("static/js/");
		registry.addResourceHandler("/img/").addResourceLocations("static/img/");
		registry.addResourceHandler("/html/").addResourceLocations("static/html/");
		registry.addResourceHandler("/static/").addResourceLocations("static/");
	}

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		registry.addRedirectViewController("/","/swagger-ui.html");
	}

}

